<!doctype html>
<head>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
test(() => {
  assert_not_equals(window.internals, undefined,
                    'This test requires clipboard access');

  assert_selection(
    [
      '<div contenteditable>',
        'a',
        '<span style="white-space:pre">	|		</span>',
        'z',
      '</div>'
    ].join(''),
    selection => {
      selection.setClipboardData('a');
      selection.document.execCommand('paste');
    },
    [
      '<div contenteditable>',
        'a',
        '<span style="white-space:pre">	</span>',
        'a|',
        '<span style="white-space:pre">		</span>',
        'z',
      '</div>'
    ].join(''));
}, 'Paste text in tabspan');
</script>
